/* Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #0d1b2a;
    --accent-color: #e0e1dd;
    --text-color: #333333;
    --light-text: #f8f9fa;
    --bg-light: #f4f6f8;
    --bg-dark: #1b263b;
    --success-color: #25d366;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    text-align: justify;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.highlight {
    color: var(--primary-color);
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(254, 254, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

/* Header: ubah warna saat discroll */
header {
    transition: background-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

/* state ketika sudah discroll */
header.scrolled {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* teks / link di header saat scrolled */
header.scrolled .logo a,
header.scrolled .desktop-nav a,
header.scrolled .mobile-toggle,
header.scrolled .back-button {
    color: #fff !important;
}

/* highlight underline untuk link aktif (buat kontras) */
header.scrolled .desktop-nav a.active::after {
    background-color: #fff !important;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo */
.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.logo a:hover {
    color: var(--primary-color);
}

.logo img {
    height: 50px;
    width: auto;
}

/* Paksa logo selalu berwarna hitam di semua halaman dan semua state */
.logo img,
.logo picture img,
header .logo img,
header.scrolled .logo img {
    /* ubah semua jenis gambar menjadi siluet hitam */
    -webkit-filter: brightness(0) saturate(100%) !important;
    filter: brightness(0) saturate(100%) !important;
    opacity: 1 !important;
}

/* Inline SVG */
.logo svg,
.logo svg * ,
header .logo svg,
header.scrolled .logo svg,
header.scrolled .logo svg * {
    fill: #000 !important;
    stroke: #000 !important;
}

/* Jika logo berupa teks/elemen warna */
.logo,
.logo a,
.logo span,
header .logo,
header.scrolled .logo {
    color: #000 !important;
}

/* Jika logo memakai background-image, beri solusi fallback (cobalah menambahkan class .logo--dark jika perlu secara manual) */
.logo {
    background-color: transparent !important;
}

/* Desktop Navigation */
.desktop-nav ul {
    display: flex;
    gap: 50px;
    align-items: center;
}

.desktop-nav a {
    font-weight: 500;
    color: var(--secondary-color);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--primary-color);
}

.desktop-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
    background: none;
    border: none;
    padding: 5px;
}

.mobile-toggle:hover {
    color: var(--primary-color);
}

.mobile-toggle.active {
    color: var(--primary-color);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(253, 253, 253, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: white;
    z-index: 1002;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* logo kiri, tombol tutup kanan */
    gap: 12px;
    padding: 12px 16px;
}

.mobile-menu-header .logo a {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    color: inherit !important;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.2rem;
}

.mobile-menu-header .logo img {
    width: 44px;
    height: auto;
    object-fit: contain;
    display: block;
    -webkit-filter: none !important;
    filter: none !important;
}

/* pastikan teks logo tidak membentuk baris baru pada layar kecil */
.mobile-menu-header .logo a span,
.mobile-menu-header .logo a em {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* kecilkan jarak di layar sangat kecil */
@media (max-width: 420px) {
    .mobile-menu-header { padding: 10px 12px; }
    .mobile-menu-header .logo img { width: 38px; }
}

.close-menu {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
    background: none;
    border: none;
    padding: 5px;
}

.close-menu:hover {
    color: var(--primary-color);
}

.mobile-nav-links {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.mobile-nav-links li {
    margin-bottom: 20px;
}

.mobile-nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    display: block;
    transition: var(--transition);
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    color: var(--primary-color);
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Footer */
footer {
    background-color: #0a131c;
    color: #777;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

footer .container {
    padding: 20px;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: #777;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color);
}

/* Page Content */
:root {
    --page-padding-top: calc(var(--header-height, 70px) + 24px);
}

main {
    padding-top: calc(var(--page-padding-top) + 12px);
    padding-bottom: 40px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
}

/* Sliding Door Page Specific Styles */
.sliding-intro {
    max-width: 980px;
    margin: 0 auto 30px;
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.sliding-intro h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-align: left;
}

.sliding-intro h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 15px;
    text-align: left;
}

.sliding-intro p {
    color: #666;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

.sliding-intro ul {
    margin-left: 20px;
    line-height: 1.8;
}

.sliding-intro li {
    margin-bottom: 12px;
    color: #555;
}

.sliding-intro strong {
    color: var(--secondary-color);
}

/* Intro row: image at left, text at right */
.intro-row {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}
.intro-image {
    flex-basis: 40%;
    max-width: 440px;
}

/* Align intro image with heading & paragraph without changing layout */
.intro-row {
    align-items: center; /* pusatkan vertikal gambar dengan konten teks */
}

/* Batasi tinggi gambar supaya tidak mendominasi baris teks */
.intro-image img {
    max-height: 260px;
    width: auto;
    object-fit: cover;
}

.sliding-features img {
    border-radius: 14px;
    width: auto;
    height: auto;
    object-fit: cover;
}

.intro-content {
    flex: 1 1 60%;
    padding-left: 8px;
}

/* Collage / cards for sliding-features */
.sliding-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 22px;
    margin-top: 20px;
    align-items: stretch;
}

/* Card */
.card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    background: #fff;
    border: 1px solid #f0f0f0;
    display: block;
    padding-bottom: 0; /* keep visual spacing from overlay */
}

.card img {
    width: auto;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.card:hover img {
    transform: scale(1.05);
}

/* Card body overlay (text) */
.card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
    color: #fff;
}
.card-body h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.card-body p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.95;
}

/* Larger card in collage */
.card--large {
    grid-column: span 1;
    grid-row: span 1;
    min-height: auto;
}

/* Make images accessible when overlay covers them */
.card[role="button"] { cursor: pointer; }


/* Card variant 2 (if needed) */
.card2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.card2 {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    background: #fff;
    border: 1px solid #f0f0f0;
    display: block;
    padding-bottom: 0; /* keep visual spacing from overlay */
}

.card2:hover img {
    transform: scale(1.05);
}

/* Card body overlay (text) */
.card2-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
    color: #fff;
}
.card2-body h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.card2-body p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.95;
}

/* Larger card in collage */
.card--large {
    grid-column: span 1;
    grid-row: span 1;
    min-height: auto;
}

/* Make images accessible when overlay covers them */
.card[role="button"] { cursor: pointer; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .desktop-nav ul {
        gap: 30px;
    }

    .sliding-intro {
        padding: 20px;
    }

    main {
        padding-left: 15px;
        padding-right: 15px;
    }

    .sliding-features { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
    .card--large { grid-column: span 1; grid-row: span 1; min-height: 160px; }
    .intro-image { max-width: 320px; flex-basis: 40%; }
}

@media (max-width: 768px) {
    /* Hide desktop nav on mobile */
    .desktop-nav {
        display: none;
    }

    /* Show mobile toggle */
    .mobile-toggle {
        display: block;
    }

    header .container {
        justify-content: space-between;
        gap: 10px;
    }

    .back-button {
        display: inline-block;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Adjust content padding on mobile */
    main {
        padding-left: 18px;
        padding-right: 18px;
        padding-top: calc(var(--page-padding-top) + 8px);
    }

    .sliding-intro {
        padding: 16px;
        margin-bottom: 20px;
    }

    .sliding-intro h2 {
        font-size: 1.5rem;
    }

    .sliding-intro h3 {
        font-size: 1.1rem;
        margin-top: 20px;
    }

    .sliding-features { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
    .card--large { grid-column: auto; grid-row: auto; min-height: 180px; }

    .intro-row { flex-direction: column; }
    .intro-image { width: 100%; max-width: none; }
}

/* Kembalikan perilaku kolom pada layar kecil agar responsif */
@media (max-width: 768px) {
    .intro-row {
        align-items: flex-start;
    }
    .intro-image img {
        max-height: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        height: 60px;
    }

    .logo a {
        font-size: 1.2rem;
        gap: 5px;
    }

    .logo img {
        height: 40px;
    }

    .back-button {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .sliding-intro h2 {
        font-size: 1.3rem;
    }

    .sliding-intro ul {
        margin-left: 15px;
    }

    /* Ensure CTA buttons stay side-by-side on narrow screens (override existing mobile rules) */
    .cta-buttons {
        display: flex;
        gap: 30px;
        justify-content: center;
        flex-wrap: nowrap; /* keep buttons in one row if space allows */
        margin-top: 30px;
    }

    .cta-buttons .btn {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    /* For very narrow screens, allow wrapping but keep them side-by-side when possible */
    @media (max-width: 420px) {
        .cta-buttons {
            flex-wrap: wrap;
            gap: 8px;
        }
        .cta-buttons .btn {
            flex: 1 1 48%; /* two buttons per row */
            max-width: 48%;
        }
    }
}

/* Override: beri jarak untuk CTA di tampilan mobile */
@media (max-width: 768px) {
    .cta-section {
        margin-top: 10px;    /* jarak atas dari section sebelumnya */
        padding-top: 12px;   /* ruang dalam agar tidak dempet */
        padding-bottom: 18px;/* ruang bawah tambahan */
    }

    .cta-buttons {
        gap: 14px;           /* jarak antar tombol */
        margin-top: 16px;    /* jarak tombol dari teks */
    }
}

/* sedikit penyesuaian untuk layar sangat kecil */
@media (max-width: 420px) {
    .cta-section .btn {
        margin-top: 10px;
        padding-top: 10px;
        padding-bottom: 14px;
    }
    .cta-buttons {
        gap: 100px;
        padding: auto;
    }
}

/* Phone & WhatsApp floats (sama seperti beranda) */
.phone-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.9rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.28);
    z-index: 999;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}

.phone-float i,
.whatsapp-float i {
    pointer-events: none;
}

/* Hover / focus */
.phone-float:hover,
.phone-float:focus,
.whatsapp-float:hover,
.whatsapp-float:focus {
    transform: translateY(4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.30);
}

/* Mobile adjustments to avoid overlap */
@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 22px;
        right: 18px;
        width: 54px;
        height: 54px;
        font-size: 1.5rem;
    }
    .phone-float {
        bottom: 86px;
        right: 18px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Header: logo biru + teks hitam sebelum scroll; logo hitam + teks putih setelah scroll */
/* Override ditempatkan paling akhir untuk menimpa aturan sebelumnya */
header:not(.scrolled) .logo img,
html body header:not(.scrolled) .logo img {
    -webkit-filter: invert(21%) sepia(83%) saturate(600%) hue-rotate(175deg) brightness(92%) contrast(95%) !important;
    filter: invert(21%) sepia(83%) saturate(600%) hue-rotate(175deg) brightness(92%) contrast(95%) !important;
    opacity: 1 !important;
}

/* SVG logo sebelum scroll jadi biru */
header:not(.scrolled) .logo svg,
header:not(.scrolled) .logo svg * {
    fill: var(--primary-color, #007bff) !important;
    stroke: var(--primary-color, #007bff) !important;
}

/* teks/header links sebelum scroll jadi hitam */
header:not(.scrolled) .desktop-nav a,
header:not(.scrolled) .mobile-toggle,
header:not(.scrolled) .back-button,
header:not(.scrolled) .logo a,
header:not(.scrolled) .logo span {
    color: #000 !important;
}

/* STATE SCROLLED: logo jadi hitam, tulisan jadi putih, header background sudah di-handle oleh header.scrolled */
header.scrolled .logo img,
html body header.scrolled .logo img {
    -webkit-filter: brightness(0) saturate(100%) !important;
    filter: brightness(0) saturate(100%) !important;
    opacity: 1 !important;
}

header.scrolled .logo svg,
header.scrolled .logo svg * {
    fill: #f10202 !important;
    stroke: #000 !important;
}

/* teks/header links saat scrolled jadi putih */
header.scrolled .desktop-nav a,
header.scrolled .mobile-toggle,
header.scrolled .back-button {
    color: #ffffff !important;
}

/* jika logo berupa teks/link, tetap tampil hitam saat scrolled (sesuai permintaan) */
header.scrolled .logo a,
header.scrolled .logo span {
    color: #fcf9f9 !important;
}